package com.xt.wikiperfumapi.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName user_collect_perfume_ref
 */
@TableName(value ="user_collect_perfume_ref")
@Data
public class UserCollectPerfumeRef implements Serializable {
    /**
     * 用户收藏香水关系表
     */
    @TableId(type = IdType.AUTO)
    private Long collectPerfumeRef;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 香水id
     */
    private Long perfumeId;

    /**
     * 是否删除
     */
    private Integer isDeleted;

    /**
     * 插入时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date inputTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserCollectPerfumeRef other = (UserCollectPerfumeRef) that;
        return (this.getCollectPerfumeRef() == null ? other.getCollectPerfumeRef() == null : this.getCollectPerfumeRef().equals(other.getCollectPerfumeRef()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getPerfumeId() == null ? other.getPerfumeId() == null : this.getPerfumeId().equals(other.getPerfumeId()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getInputTime() == null ? other.getInputTime() == null : this.getInputTime().equals(other.getInputTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCollectPerfumeRef() == null) ? 0 : getCollectPerfumeRef().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getPerfumeId() == null) ? 0 : getPerfumeId().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getInputTime() == null) ? 0 : getInputTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", collectPerfumeRef=").append(collectPerfumeRef);
        sb.append(", userId=").append(userId);
        sb.append(", perfumeId=").append(perfumeId);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", inputTime=").append(inputTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}